package cn.mxz.service.impl;

import cn.mxz.mapper.ProductCommentsMapper;
import cn.mxz.pojo.ProductComments;
import cn.mxz.service.ProductCommentsService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductCommentsServiceImpl implements ProductCommentsService {
    @Autowired
    private ProductCommentsMapper productCommentsMapper;
    @Override
    public List<ProductComments> getProductComments(String pid) {
        QueryWrapper<ProductComments> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("product_id",pid);
        List<ProductComments> productComments = productCommentsMapper.selectList(queryWrapper);
        return productComments;
    }
}
